<?php
class AcessoRestritoController extends Zend_Controller_Action
{
	private $loginName;
	private $idLogin;
	private $Username;
	private $local;
        private $idCliente;
	
	public function init()
	{
		$session = Zend_Registry::get('session');
	
                
                
		if(!isset($session->login))
		{
			$this->_redirect('/autenticacao');
		}
		else 
		{
                        
                        $this->setIdLogin($session->id);
			
			$this->setLoginName($session->login);
			
			$this->setUserName($session->nomeUsuario);
			
			$this->setLocal($session->local);
                        
                        $this->setIdCliente($session->idCliente);
                        
                        
		}
                
                
                

}
	
	private function setIdLogin($id){
		$this->idLogin   = $id;		
	}	
	private function setLoginName($login){
		$this->loginName   = $login;		
	}
	private function setUserName($userName){
		$this->Username   = $userName;		
	}
	
	private function setIdCliente($id){
		$this->idCliente   = $id;		
	}	
        public function getIdLogin(){
		return $this->idLogin;
	}
	public function getIdCliente(){
		return $this->idCliente;
	}
        public function getLoginName(){
		return $this->loginName;
	}
	public function getUserName(){
		return $this->Username;
	}
	
	public function setLocal($local)
	{
		$this->local= $local;
	}
	public function getLocal()
	{
		return $this->local;
	}
        
        public function getClienteName(){
              $dao = new Cliente();
              $cliente= $dao->_getNomeCliente($this->idCliente);
		return $cliente->nomeCurto;
	}
	
}
?>